//
//  SportTableViewCell.swift
//  FengHuangNews
//
//  Created by 新宝 on 2018/12/19.
//  Copyright © 2018年 LaiShengCai. All rights reserved.
//

import UIKit
import SnapKit
class SportTableViewCell: UITableViewCell {
    var headImageView:UIImageView!
    var titleLabel:UILabel!
    var timeLabel:UILabel!
    
    
   override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        self.separatorInset=UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
        headImageView=UIImageView(frame: CGRect(x: 2, y: 5, width: 90, height: 90))
        self.contentView.addSubview(headImageView)
        
        //标题
        titleLabel=UILabel(frame: CGRect(x: 92, y: 0, width: ScreenWidth-92, height: 30))
        self.titleLabel?.backgroundColor = UIColor.clear;
        self.titleLabel.numberOfLines=0
        self.titleLabel?.textColor = UIColor.black
        self.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        self.titleLabel?.textAlignment = NSTextAlignment.left
        
        //时间
        timeLabel=UILabel(frame: CGRect(x: 92, y: 30, width: ScreenWidth-92, height: 30))
        timeLabel?.backgroundColor = UIColor.clear;
        timeLabel.numberOfLines=0
        timeLabel.textColor = UIColor(red: 102/255, green: 102/255, blue: 102/255, alpha: 1)
        timeLabel.font = UIFont.systemFont(ofSize: 12)
        timeLabel.textAlignment = NSTextAlignment.left
        
        
        self.contentView.addSubview(titleLabel)
        self.contentView.addSubview(timeLabel)
        
        titleLabel.snp.makeConstraints { (make) in
          make.top.equalToSuperview().offset(5)
            make.left.equalTo(headImageView.snp.right).offset(5)
            make.right.equalToSuperview().offset(-5)
        }
        
        timeLabel.snp.makeConstraints { (make) in
            make.left.equalTo(headImageView.snp.right).offset(5)
            make.right.equalToSuperview().offset(-5)
            make.bottom.equalToSuperview().offset(-5)
        }
        
        
    }
    

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        // Configure the view for the selected state
    }

}
